package org.eduapp.trains.service.order;

import java.util.List;

import org.eduapp.trains.ServiceException;
import org.eduapp.trains.model.account.ModelAccount;
import org.eduapp.trains.model.order.ModelOrder;
import org.eduapp.trains.web.support.PaginationSupport;

/**
 * 
 * @author jeccy
 *
 */
public interface OrderService {
	
	/**
	 * Get order by given id
	 * @param id
	 * @return
	 */
	ModelOrder get (String id)
		throws ServiceException;
	
	/**
	 * Get orders by pager
	 * @param model
	 * @param pageSize
	 * @param offset
	 * @param order
	 * @param isDesc
	 * @return
	 * @throws ServiceException
	 */
	PaginationSupport<ModelOrder> get (ModelOrder model, int pageSize, int offset, String order, Boolean isDesc)
		throws ServiceException;
	
	/**
	 * Save or update order by given model
	 * @param model
	 * @return
	 */
	boolean saveOrUpdate (ModelOrder model)
		throws ServiceException;
	
	/**
	 * Remove order by given id 
	 * @param id
	 * @return
	 */
	boolean remove (String id)
		throws ServiceException;

	PaginationSupport<ModelOrder> get(ModelOrder model, String ids,
			int pageSize, int offset, String order, Boolean isDesc)
			throws ServiceException;
	
}
